import { EventClass } from "@lib/alen-helper/node/baseClass";
export namespace MainSDK {
    export type SendSrcData = number | string | boolean | bigint | null | Buffer;
    export type SendSrcArr = (SendSrcData | SendSrcObj | SendSrcArr)[];
    export type SendSrcObj = { [k: string]: SendSrcArr | SendSrcData | SendSrcObj };
    export type SendData = SendSrcObj | SendSrcArr | SendSrcData;
}

class MainSDK extends EventClass<{
    SrcMessage: MainSDK.SendData,
}> {

    constructor(
        BaseOptions?: Partial<EventClass.BaseOptions>
    ) {
        super('MainSDK', BaseOptions);
    }

    private _send(data: MainSDK.SendData) {
        if (!process.send) throw this._err('项目不可用', '进程无发送函数');
        process.send(data);
    }

    private _init() {
        process.on('message', (message) => {

        });
    }
}